package com.cmc.cloud.cmclink.doc.api.document.rep;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 海运费附加费 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author codegen
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BlnoFreightBaseDto {

    @Schema(description = "主键")
    private Long id;

    @Schema(description = "提单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19993")
    @NotNull(message = "{blnofreight.blnoid.notnull}")
    private Long blnoId;

    @Schema(description = "费用代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blnofreight.chargecode.notblank}")
    @Length(max = 6, message = "{blnofreight.chargecode.length}")
    private String chargeCode;

    @Schema(description = "计费维度 C=按体积吨计费，N=按箱计费，Y=按票计费", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blnofreight.per.notblank}")
    @Length(max = 1, message = "{blnofreight.per.length}")
    private String per;

    @Schema(description = "箱型", example = "2")
    @Length(max = 2, message = "{blnofreight.cntrtype.length}")
    private String cntrType;

    @Schema(description = "箱尺寸")
    @Length(max = 2, message = "{blnofreight.cntrsize.length}")
    private String cntrSize;

    @Schema(description = "货类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotBlank(message = "{blnofreight.cargotype.notblank}")
    @Length(max = 5, message = "{blnofreight.cargotype.length}")
    private String cargoType;

    @Schema(description = "件数", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "{blnofreight.quantity.notnull}")
    private BigDecimal quantity;

    @Schema(description = "费率", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "{blnofreight.rate.notnull}")
    private BigDecimal rate;

    @Schema(description = "金额", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "{blnofreight.amount.notnull}")
    private BigDecimal amount;

    @Schema(description = "币种", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blnofreight.currency.notblank}")
    @Length(max = 3, message = "{blnofreight.currency.length}")
    private String currency;

    @Schema(description = "付费方式", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{blnofreight.payment.notblank}")
    @Length(max = 1, message = "{blnofreight.payment.length}")
    private String payment;

    @Schema(description = "付费人")
    @Length(max = 50, message = "{blnofreight.payer.length}")
    private String payer;

    @Schema(description = "转财务", requiredMode = Schema.RequiredMode.REQUIRED, example = "5427")
    @NotNull(message = "{blnofreight.toaccount.notnull}")
    private Boolean toAccount;

    @Schema(description = "记录类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotBlank(message = "{blnofreight.recordtype.notblank}")
    @Length(max = 10, message = "{blnofreight.recordtype.length}")
    private String recordType;

    @Schema(description = "第三付费地")
    @Length(max = 50, message = "{blnofreight.thirdpaymentplace.length}")
    private String thirdPaymentPlace;

    @Schema(description = "原始费用id", example = "14136")
    private Long originalId;

    @Schema(description = "协议号")
    @Length(max = 50, message = "{blnofreight.agreementno.length}")
    private String agreementNo;

}
